function StartAssistant(){
	
}

function createAd(){
	 if(typeof mojiva_ad == 'undefined') {
       var mojiva_ad = {};
       mojiva_ad.count = 0;
   }
   mojiva_siteId = '3922';
   mojiva_zoneId = '4650';
   mojiva_browserTarget = ''; // link target ex. _blank
   mojiva_trackingUrl = ''; // url for additional tracking
   mojiva_adstype = '3'; // type of ads (1 - text only, 2 - images only, 3 - text + images)
   mojiva_defaultHtml = ''; // default ad instead of empty
   //mojiva_lat = '';
   //mojiva_long = '';
      mojiva_borderColor = '#000000'; // ads border color
   mojiva_headerColor = '#cccccc'; // header color
   mojiva_bgColor = '#eeeeee'; // background color
   mojiva_textColor = '#000000'; // text color
   mojiva_linkColor = '#ff0000'; // url color

}

StartAssistant.prototype.setup = function(){
	
	this.buttonAttributes = {};
	
	this.buttonModel = {
		buttonLabel : 'Start Game',
		buttonClass : '',
		disabled : false
	};
	
	this.controller.setupWidget("start", this.buttonAttributes, this.buttonModel);
	Mojo.Event.listen(this.controller.get('start'), Mojo.Event.tap, this.startGame.bind(this));
	
	this.buttonAttributes = {};
	
	this.buttonModel = {
		buttonLabel : 'Preferences',
		buttonClass : '',
		disabled : false
	};
	
	this.controller.setupWidget("settingsButton", this.buttonAttributes, this.buttonModel);
	Mojo.Event.listen(this.controller.get('settingsButton'), Mojo.Event.tap, this.settings.bind(this));
	this.buttonAttributes = {};
	
	this.buttonModel = {
		buttonLabel : 'Tutorial',
		buttonClass : '',
		disabled : false
	};
	
	this.controller.setupWidget("tutorialButton", this.buttonAttributes, this.buttonModel);
	Mojo.Event.listen(this.controller.get('tutorialButton'), Mojo.Event.tap, this.tutorial.bind(this));
	// the following is sudo code for implementing audio in the future.	
		/*this.controller.serviceRequest('palm://com.palm.applicationManager', {
		method:'open',    
		parameters:{target : Mojo.appPath + "audio/lemon_tycoon.mp3"        
		}
	});*/
	/*var audioObj = AudioTag.extendElement('audioDiv');
	this.audioObj.play();*/
	/*this.backgroundMusic = new Audio();
	var file = Mojo.appPath + 'audio/lemon_tycoon.mp3';
	this.backgroundMusic.src = file;
	this.backgroundMusic.play();	*/
	  /*this.controller.setupWidget('web-view', {url:this.link});

  this.reloadModel = {
    label: $L('Reload'),
    icon: 'refresh',
    command: 'refresh'
  };

  this.stopModel = {
    label: $L('Stop'),
    icon: 'load-progress',
    command: 'stop'
  };*/

//mojo-event-webViewLoadProgress           
//mojo-event-webViewLoadStarted
//mojo-event-webViewLoadStopped
//mojo-event-webViewLoadFailed
//mojo-event-webViewDownloadFinished
//mojo-event-webViewLinkClicked
//mojo-event-webViewDownloadFinished
//mojo-event-webViewTitleUrlChanged
//mojo-event-webViewTitleChanged
//mojo-event-webViewUrlChanged
//mojo-event-webViewCreatePage
//mojo-event-webViewTapRejected
//mojo-event-webViewScrollAndScaleChanged
//mojo-event-webViewEditorFocused
//mojo-event-webViewUpdateHistory
//mojo-event-webViewSetMainDocumentError
//mojo-event-webViewServerConnect
//mojo-event-webViewServerDisconnect
//mojo-event-webViewResourceHandoff
//mojo-event-webViewFirstPaintComplete
//mojo-event-webViewUrlRedirect
//mojo-event-webViewModifierTap
//mojo-event-webViewMimeNotSupported
//mojo-event-webViewMimeHandoff
  //this.progress = this.progress.bind(this);
  /*this.started = this.started.bind(this);
  this.stopped = this.stopped.bind(this);
  this.finished = this.finished.bind(this);
  
  
 // Mojo.Event.listen(this.controller.get('web-view'), Mojo.Event.webViewLoadProgress, this.progress);
  Mojo.Event.listen(this.controller.get('web-view'), Mojo.Event.webViewLoadStarted, this.started);
  Mojo.Event.listen(this.controller.get('web-view'), Mojo.Event.webViewLoadStopped, this.stopped);
  Mojo.Event.listen(this.controller.get('web-view'), Mojo.Event.webViewLoadFailed, this.stopped);
  Mojo.Event.listen(this.controller.get('web-view'), Mojo.Event.webViewDidFinishDocumentLoad, this.stopped);
  Mojo.Event.listen(this.controller.get('web-view'), Mojo.Event.webViewDownloadFinished, this.finished);*/
}

StartAssistant.prototype.startGame = function(event){
	this.controller.stageController.pushScene('day');
}

StartAssistant.prototype.settings = function(event){
	this.controller.stageController.pushScene('settings');
}

StartAssistant.prototype.tutorial = function(event){
	this.controller.stageController.pushScene('tutorial00');
}

StartAssistant.prototype.activate = function(event) {
	createAd();

}

StartAssistant.prototype.handleCommand = function (event) {
	this.controller=Mojo.Controller.stageController.activeScene();
    if (event.type == Mojo.Event.commandEnable &&
	    (event.command == Mojo.Menu.helpCmd)) {
         event.stopPropagation(); // enable help. now we have to handle it
    }
	 if (event.type == Mojo.Event.commandEnable &&
	    (event.command == Mojo.Menu.prefsCmd)) {
         event.stopPropagation(); // enable help. now we have to handle it
    }

	console.log("RIGHT HERE");
	if (event.type == Mojo.Event.command) {
		var youOrdered = "";
		console.log("SettingsSceneAssistant::handleCommand(): Got command: " + event.command);
		switch (event.command) {
			
			// another built-in menu item, but we've enabled it (see below in this method)
			// so now we have to handle it:
			case Mojo.Menu.helpCmd:
				Mojo.Controller.stageController.pushScene('support');
				break;
				
			case Mojo.Menu.prefsCmd:
				Mojo.Controller.stageController.pushScene('settings');
				break;
		}
	}	
}

StartAssistant.prototype.deactivate = function(event) {
	/* remove any event handlers you added in activate and do any other cleanup that should happen before
	   this scene is popped or another scene is pushed on top */
}

StartAssistant.prototype.cleanup = function(event) {
	/* this function should do any cleanup needed before the scene is destroyed as 
	   a result of being popped off the scene stack */
}